import Vue from 'vue'
import Vuex from 'vuex'
const actions = {
    add(context,value){
        context.commit('ADD',value);
    },
    addOdd(context,value){
        context.commit('ADDODD',value);
    },
}
const mutations = {
    ADD(e,value){
        state.num += value
    },
    ADDODD(e,value){
        if(value%2!==0){
            state.num += value
        }
    }
}
const state = {
    num: 0
}

Vue.use(Vuex)
export default new Vuex.Store({
    actions,
    mutations,
    state,
})